package com.single;

/**
 * 懒汉模式
 *
 * 即解决安全问题，又解决性能问题
 */
public class Singleton {

    private static class LazyHolder{
        private static final Singleton SINGLETON = new Singleton();
    }

    private Singleton() {
    }

    public static final Singleton getInstance() {
        return LazyHolder.SINGLETON;
    }
}
